<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Như Quỳnh</title>
<link rel="stylesheet" href="css/admin/screen.css" type="text/css" media="screen" title="default" />

<!--  jquery core -->
<script src="js/jquery/jquery-1.4.1.min.js" type="text/javascript"></script>

<!-- Custom jquery scripts -->
<script src="js/jquery/custom_jquery.js" type="text/javascript"></script>

<!-- MUST BE THE LAST SCRIPT IN <HEAD></HEAD></HEAD> png fix -->
<script src="js/jquery/jquery.pngFix.pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(document).pngFix( );
});
function checkvalidate()
{
	var result;
	if ($('#username').val().length < 1)
	{
		$('#username_err').show();
		result = false;
	}else
	{
		$('#username_err').hide();
		result = true;
	}
	if ($('#password').val().length < 1)
	{
		$('#password_err').show();
		result = false;
	}else
	{
		$('#password_err').hide();
		result = true;
	}
	return result;
	}
</script>
</head>
<body id="login-bg">
<form name="form1" method="post" action="admin.php?do=login&act=sm">
  <div id="login-holder"> 
    <!-- start logo -->
    <div id="logo-login"> 
    <!--<a href="index.html"><img width="160"  alt="" src="images/shared/logo.png"></a>--> 
    </div>
    <!-- end logo -->
    
    <div class="clear"></div>
	<?php
			$showCaptcha = false;

			if (isset($_SESSION['counter_login']))
			{
				if ($_SESSION['counter_login'] > 4)
				{
					$showCaptcha = true;
				}
			}
			//echo $_SESSION['counter_login'];
	?>
    <!--  start loginbox ................................................................................. -->
    <div id="loginbox" style='<?php 
if ($showCaptcha)
{
	echo 'height: 212px; padding-top: 	50px;';
}
    ?>'> 
      
      <!--  start login-inner -->
      <div id="login-inner">
      	<center><? if(isset($msg)) echo $msg.'<br/><br/>';?></center>
        <table border="0" cellpadding="0" cellspacing="0">
          <tbody>
            <tr>
              <th>Username <span id="username_err" style="color:red;display:none;">*</span></th>
              <td><input type="text" id="username" name="username" class="login-inp">
             
              </td>
            </tr>
            <tr>
              <th>Password
               <span id="password_err" style="color:red;display:none;">*</span>
              </th>
              <td><input  name="password" type="password" id="password" class="login-inp" onfocus="this.value=''" value=""></td>
            </tr>
           <input type="hidden" id="checkcaptcha" name="checkcaptcha" value="<?= ($showCaptcha)? 'true':'false' ?>" />
            <tr style="<?= ($showCaptcha)? '':'display:none;' ?>">
            
              <th>Security Images</th>
              <td><img src="CaptchaSecurityImages.php?width=100&height=40&characters=6" /></td>
            </tr>
            <tr style="<?= ($showCaptcha)? '':'display:none;' ?>">
              <th> </th>
              <td><input name="security_code" type="text" id="security_code"  class="login-inp" ></td>
            </tr>
            
            <tr>
              <th></th>
              <td><input type="submit" onclick="return checkvalidate();" class="submit-login"></td>
            </tr>
          </tbody>
        </table>
      </div>
      <!--  end login-inner -->
      <div class="clear"></div>
      <a class="forgot-pwd" href="admin.php?do=login&act=forgot">Forgot Password?</a> </div>
  </form>  
    <!--  end loginbox --> 
    
    <!--  start forgotbox ................................................................................... -->
    <div id="forgotbox">
      <div id="forgotbox-text">Please send us your email and we'll reset your password.</div>
      <!--  start forgot-inner -->
      <div id="forgot-inner">
      	<form name="form1" method="post" action="admin.php?do=login&act=forgotsm">
        <table border="0" cellpadding="0" cellspacing="0">
          <tbody>
            <tr>
              <th>Email address:</th>
              <td><input type="text" class="login-inp" name="email" value=""></td>
            </tr>
            <tr>
              <th> </th>
              <td><input type="submit" class="submit-login"></td>
            </tr>
          </tbody>
        </table>
        </form>
      </div>
      <!--  end forgot-inner -->
      <div class="clear"></div>
      <a href="" class="back-login">Back to login</a> </div>
    <!--  end forgotbox --> 
    
  </div>
</body>
</html>
<? if(isset($_SESSION['mess'])) echo AlertMessage($_SESSION['mess']); unset($_SESSION['mess']); ?>